3.1033 \(\int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-4-p} \, dx\)

Optimal. Leaf size=239 \[ \frac{2 (3 A-B (p+4)) (c-c \sin (e+f x))^{-p-2} (g \cos (e+f x))^{p+1}}{c^2 f g (p+3) (p+5) (p+7)}+\frac{2 (3 A-B (p+4)) (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1}}{c^3 f g (p+1) (p+3) (p+5) (p+7)}+\frac{(A+B) (c-c \sin (e+f x))^{-p-4} (g \cos (e+f x))^{p+1}}{f g (p+7)}+\frac{(3 A-B (p+4)) (c-c \sin (e+f x))^{-p-3} (g \cos (e+f x))^{p+1}}{c f g (p+5) (p+7)} \]

[Out]

((A + B)*(g*Cos[e + f*x])^(1 + p)*(c - c*Sin[e + f*x])^(-4 - p))/(f*g*(7 + p)) + ((3*A - B*(4 + p))*(g*Cos[e +
 f*x])^(1 + p)*(c - c*Sin[e + f*x])^(-3 - p))/(c*f*g*(5 + p)*(7 + p)) + (2*(3*A - B*(4 + p))*(g*Cos[e + f*x])^
(1 + p)*(c - c*Sin[e + f*x])^(-2 - p))/(c^2*f*g*(3 + p)*(5 + p)*(7 + p)) + (2*(3*A - B*(4 + p))*(g*Cos[e + f*x
])^(1 + p)*(c - c*Sin[e + f*x])^(-1 - p))/(c^3*f*g*(1 + p)*(3 + p)*(5 + p)*(7 + p))

________________________________________________________________________________________

Rubi [A]  time = 0.440974, antiderivative size = 239, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.079, Rules used = {2859, 2672, 2671} \[ \frac{2 (3 A-B (p+4)) (c-c \sin (e+f x))^{-p-2} (g \cos (e+f x))^{p+1}}{c^2 f g (p+3) (p+5) (p+7)}+\frac{2 (3 A-B (p+4)) (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1}}{c^3 f g (p+1) (p+3) (p+5) (p+7)}+\frac{(A+B) (c-c \sin (e+f x))^{-p-4} (g \cos (e+f x))^{p+1}}{f g (p+7)}+\frac{(3 A-B (p+4)) (c-c \sin (e+f x))^{-p-3} (g \cos (e+f x))^{p+1}}{c f g (p+5) (p+7)} \]

Antiderivative was successfully verified.

[In]

Int[(g*Cos[e + f*x])^p*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x])^(-4 - p),x]

[Out]

((A + B)*(g*Cos[e + f*x])^(1 + p)*(c - c*Sin[e + f*x])^(-4 - p))/(f*g*(7 + p)) + ((3*A - B*(4 + p))*(g*Cos[e +
 f*x])^(1 + p)*(c - c*Sin[e + f*x])^(-3 - p))/(c*f*g*(5 + p)*(7 + p)) + (2*(3*A - B*(4 + p))*(g*Cos[e + f*x])^
(1 + p)*(c - c*Sin[e + f*x])^(-2 - p))/(c^2*f*g*(3 + p)*(5 + p)*(7 + p)) + (2*(3*A - B*(4 + p))*(g*Cos[e + f*x
])^(1 + p)*(c - c*Sin[e + f*x])^(-1 - p))/(c^3*f*g*(1 + p)*(3 + p)*(5 + p)*(7 + p))

Rule 2859

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)]), x_Symbol] :> Simp[((b*c - a*d)*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m)/(a*f*g*(2*m +
p + 1)), x] + Dist[(a*d*m + b*c*(m + p + 1))/(a*b*(2*m + p + 1)), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^
(m + 1), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[a^2 - b^2, 0] && (LtQ[m, -1] || ILtQ[Simplify[
m + p], 0]) && NeQ[2*m + p + 1, 0]

Rule 2672

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(b*(g*
Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m)/(a*f*g*Simplify[2*m + p + 1]), x] + Dist[Simplify[m + p + 1]/(a*
Simplify[2*m + p + 1]), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{a, b, e, f, g, m
, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[Simplify[m + p + 1], 0] && NeQ[2*m + p + 1, 0] &&  !IGtQ[m, 0]

Rule 2671

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(b*(g*
Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m)/(a*f*g*m), x] /; FreeQ[{a, b, e, f, g, m, p}, x] && EqQ[a^2 - b^
2, 0] && EqQ[Simplify[m + p + 1], 0] &&  !ILtQ[p, 0]

Rubi steps

\begin{align*} \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-4-p} \, dx &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-4-p}}{f g (7+p)}+\frac{(3 A-B (4+p)) \int (g \cos (e+f x))^p (c-c \sin (e+f x))^{-3-p} \, dx}{c (7+p)}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-4-p}}{f g (7+p)}+\frac{(3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-3-p}}{c f g (5+p) (7+p)}+\frac{(2 (3 A-B (4+p))) \int (g \cos (e+f x))^p (c-c \sin (e+f x))^{-2-p} \, dx}{c^2 (5+p) (7+p)}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-4-p}}{f g (7+p)}+\frac{(3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-3-p}}{c f g (5+p) (7+p)}+\frac{2 (3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-2-p}}{c^2 f g (3+p) (5+p) (7+p)}+\frac{(2 (3 A-B (4+p))) \int (g \cos (e+f x))^p (c-c \sin (e+f x))^{-1-p} \, dx}{c^3 (3+p) (5+p) (7+p)}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-4-p}}{f g (7+p)}+\frac{(3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-3-p}}{c f g (5+p) (7+p)}+\frac{2 (3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-2-p}}{c^2 f g (3+p) (5+p) (7+p)}+\frac{2 (3 A-B (4+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{c^3 f g (1+p) (3+p) (5+p) (7+p)}\\ \end{align*}

Mathematica [A]  time = 0.526017, size = 160, normalized size = 0.67 \[ \frac{\cos (e+f x) (c-c \sin (e+f x))^{-p} (g \cos (e+f x))^p \left (\left (p^2+8 p+13\right ) (B (p+4)-3 A) \sin (e+f x)+(2 B (p+4)-6 A) \sin ^3(e+f x)-2 (p+4) (B (p+4)-3 A) \sin ^2(e+f x)+A \left (p^3+12 p^2+41 p+36\right )-B \left (p^2+8 p+13\right )\right )}{c^4 f (p+1) (p+3) (p+5) (p+7) (\sin (e+f x)-1)^4} \]

Antiderivative was successfully verified.

[In]

Integrate[(g*Cos[e + f*x])^p*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x])^(-4 - p),x]

[Out]

(Cos[e + f*x]*(g*Cos[e + f*x])^p*(-(B*(13 + 8*p + p^2)) + A*(36 + 41*p + 12*p^2 + p^3) + (13 + 8*p + p^2)*(-3*
A + B*(4 + p))*Sin[e + f*x] - 2*(4 + p)*(-3*A + B*(4 + p))*Sin[e + f*x]^2 + (-6*A + 2*B*(4 + p))*Sin[e + f*x]^
3))/(c^4*f*(1 + p)*(3 + p)*(5 + p)*(7 + p)*(-1 + Sin[e + f*x])^4*(c - c*Sin[e + f*x])^p)

________________________________________________________________________________________

Maple [F]  time = 0.726, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{p} \left ( A+B\sin \left ( fx+e \right ) \right ) \left ( c-c\sin \left ( fx+e \right ) \right ) ^{-4-p}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-4-p),x)

[Out]

int((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-4-p),x)

________________________________________________________________________________________

Maxima [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-4-p),x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

Fricas [A]  time = 1.65411, size = 478, normalized size = 2. \begin{align*} \frac{{\left (2 \,{\left (B p^{2} -{\left (3 \, A - 8 \, B\right )} p - 12 \, A + 16 \, B\right )} \cos \left (f x + e\right )^{3} +{\left (A p^{3} + 3 \,{\left (4 \, A - B\right )} p^{2} +{\left (47 \, A - 24 \, B\right )} p + 60 \, A - 45 \, B\right )} \cos \left (f x + e\right ) -{\left (2 \,{\left (B p - 3 \, A + 4 \, B\right )} \cos \left (f x + e\right )^{3} -{\left (B p^{3} - 3 \,{\left (A - 4 \, B\right )} p^{2} -{\left (24 \, A - 47 \, B\right )} p - 45 \, A + 60 \, B\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 4}}{f p^{4} + 16 \, f p^{3} + 86 \, f p^{2} + 176 \, f p + 105 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-4-p),x, algorithm="fricas")

[Out]

(2*(B*p^2 - (3*A - 8*B)*p - 12*A + 16*B)*cos(f*x + e)^3 + (A*p^3 + 3*(4*A - B)*p^2 + (47*A - 24*B)*p + 60*A -
45*B)*cos(f*x + e) - (2*(B*p - 3*A + 4*B)*cos(f*x + e)^3 - (B*p^3 - 3*(A - 4*B)*p^2 - (24*A - 47*B)*p - 45*A +
 60*B)*cos(f*x + e))*sin(f*x + e))*(g*cos(f*x + e))^p*(-c*sin(f*x + e) + c)^(-p - 4)/(f*p^4 + 16*f*p^3 + 86*f*
p^2 + 176*f*p + 105*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))**p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))**(-4-p),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-4-p),x, algorithm="giac")

[Out]

Exception raised: AttributeError